//
//  BaseTableView.h
//  TableView
//
//  Created by Maple on 13-7-1.
//  Copyright (c) 2013年 ci123. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "EGORefreshTableHeaderView.h"

@class BaseTableView;

@protocol TableViewEGORefresh <NSObject>

@optional

- (void)pullDown:(BaseTableView *)base;

- (void)loadMore:(BaseTableView *)base;

- (void)tableView:(BaseTableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;

- (void)tableViewBeginDragging:(UIScrollView *)scrollView;

@end

@interface BaseTableView : UITableView<
    EGORefreshTableHeaderDelegate,
    UITableViewDataSource,
    UITableViewDelegate
>{
  EGORefreshTableHeaderView *_refreshHeaderView;
  BOOL _reloading;
  
  UIView *_loadingView;
  UIButton *_loadingButton;
  UIActivityIndicatorView *_loadingActivity;
}

@property (nonatomic,weak)id <TableViewEGORefresh>egoFreshDelegate;

//是否需要下拉刷新
@property (nonatomic,assign)BOOL isheaderView;//default YES
@property (nonatomic,retain)NSArray *data;

//点击下载
@property (nonatomic,assign)BOOL needAutoModifiedByData;        //default YES 是否需要根据数据来自动修改加载按钮
@property (nonatomic,assign)BOOL isLoadingMore;
@property (nonatomic,assign)BOOL isfooterView;                  //default YES
@property (nonatomic,assign)BOOL isAutoload;                    //default YES
@property NSInteger  pageNum;//每页条数

- (void)doneLoadingTableViewData;
- (void)doneLoadingMore:(BOOL)isHidden;
- (void)refreshLoading;//触发刷新
@end
